//
//  SAPWebViewController.m
//  CarsHome
//
//  Created by dapeng on 15/12/3.
//  Copyright © 2015年 dapeng. All rights reserved.
//

#import "SAPWebViewController.h"
#import "UMSocial.h"
@interface SAPWebViewController ()<UIWebViewDelegate>

@end

@implementation SAPWebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSURL *url = [NSURL URLWithString:_url];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_SIZE.width, SCREEN_SIZE.height)];
    webView.backgroundColor = [UIColor clearColor];
    [webView loadRequest:request];
    webView.scalesPageToFit = YES;
    webView.delegate = self;
    [self.view addSubview:webView];
    [webView release];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"share"] style:UIBarButtonItemStyleDone target:self action:@selector(collectPage:)];
    self.view.backgroundColor = [UIColor whiteColor];
  
    
}


- (void)collectPage:(UIBarButtonItem *)collect {
    [UMSocialSnsService presentSnsIconSheetView:self
                                         appKey:@"566ac50867e58e722a005bbd"
                                      shareText:self.url
                                     shareImage:[UIImage imageNamed:@"icon.png"]
                                shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina,nil]
                                       delegate:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
